/*
 * interactions.cpp
 *
 *  Created on: 26/dic/2012
 *      Author: Administrator
 */


#include "bodies.h"
#include "eparticles.h"
#include "interactions.h"
#include "costants.h"

#include <iostream>
using namespace std;



double calcColumb(particle &q1,particle &q2,body &b1){
  cout << "\nCalcolo legge di columb";
  cout << "\n\tr=";
  //trovo r
  double r;
  r=sqrt(pow((q1.pos_x - q2.pos_x),2)+pow((q1.pos_y - q2.pos_y),2));
  cout << r;
  //cout << "r(q1,q2) = " << r << endl;

  cout << "\n\tK=";
  //double K = 1/(4*M_PI*b1.calcE);
  //cout<<K;
  double K=1;
  cout << "\n\tF(q1,q2)=";
  double f;
  f=K*q1.columb*q2.columb/pow(r,2);
  //cout << "F(q1,q2) = " << f << " N*m^2/C^2" << endl;
  cout << f << " N*m^2/C^2";
  return f;
}


